<h2>Why is this an issue?</h2>
<p>TypeScript allows declaring the type of a function in two different ways:</p>
<ul>
  <li> Function type: <code>() ⇒ number</code> </li>
  <li> Object type with a call signature: <code>{ (): number }</code> </li>
</ul>
<p>The function type syntax is generally preferred for being more concise.</p>
<h2>How to fix it</h2>
<p>Use a function type instead of an interface or object type literal with a single call signature.</p>
<h3>Code examples</h3>
<h4>Noncompliant code example</h4>
<pre data-diff-id="1" data-diff-type="noncompliant">
function apply(f: { (): string }): string {
  return f();
}
</pre>
<h4>Compliant solution</h4>
<pre data-diff-id="1" data-diff-type="compliant">
function apply(f: () =&gt; string): string {
  return f();
}
</pre>
<h4>Noncompliant code example</h4>
<pre data-diff-id="2" data-diff-type="noncompliant">
interface Foo {
  (): number;
}
</pre>
<h4>Compliant solution</h4>
<pre data-diff-id="2" data-diff-type="compliant">
type Foo = () =&gt; number;
</pre>
<h2>Resources</h2>
<h3>Documentation</h3>
<ul>
  <li> <a href="https://typescript-eslint.io/">typescript-eslint</a> - Rule <a
  href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-function-type.mdx">prefer-function-type</a> </li>
  <li> TypeScript Documentation - <a href="https://www.typescriptlang.org/docs/handbook/2/functions.html#function-type-expressions">Function Type
  Expressions</a> </li>
</ul>
